package com.github.aloxc.plugin.restplus.method;
/**
 *
 * @author leero
 */
public class RequestPath {
    String path;
    String method;
    String description;

    public RequestPath(String path, String method,String description) {
        this.path = path;
        this.method = method;
        this.description = description;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void concat(RequestPath classRequestPath) {
        String classUri = classRequestPath.getPath();
        String methodUri = this.path;
        //TODO
        if (!classUri.startsWith("/")) {
            classUri = "/".concat(classUri);
        }
        if (!classUri.endsWith("/")) {
            classUri = classUri.concat("/");
        }
        if (this.path.startsWith("/")) {
            methodUri = this.path.substring(1, this.path.length());
        }

        this.path = classUri.concat(methodUri) ;
//        method
    }
}
